package components.game
{
	import UIFree.controls.uif_label;
	import UIFree.uif_component;
	
	import components.base.uif_source;
	
	import flash.geom.Point;
	import flash.geom.Rectangle;

	public class clt_vicItem extends clt_gameItem {
		private const ISIZE: Point = new Point(49, 48);
		private var _timeLabel: uif_label;
		public function clt_vicItem(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, gameData:Object=null, styleClass:String='') {
			super(parent, ax, ay, awidth, aheight, gameData, styleClass);
		}
	
		override protected function createComponents(): void {
			super.createComponents();
			if (data) {
				var inner: Rectangle = getInner();
				_timeLabel = new uif_label(this, inner.x, inner.y, inner.width, 30, 'userName');
				_timeLabel.text = this.data.ftime;
				
				var ctrl: uif_source = new uif_source(this, inner.x + inner.width - ISIZE.x, 0, 
							ISIZE.x, ISIZE.y);
				ctrl.loadSource(clt_servers.IMAGE_URL + 'k02.png');
			}
		}
		
		override protected function updateBounds():uif_component {
			super.updateBounds();
			if (_timeLabel) _timeLabel.x = (width - _timeLabel.width) / 2;
			return this;
		}
	}
}